<script lang="ts" setup>
const props = defineProps({
  num: {
    type: Number,
    required: true,
    default: 0,
  },
});

const paddingResult = computed(() => {
  var res = {
    type: "error",
    desc: "无选择框",
    extra: "没有找到选择框，请确认是否真的存在或者联系管理员",
  };
  if (props.num == undefined || props == null) {
    return res;
  }

  if (props.num > 0) {
    return {
      type: "success",
      desc: "找到选择框:" + props.num,
      extra: "已找到选择框, 核对数据完成",
    };
  }

  return res

});
</script>

<template>
  <div class="sinfobody">
    <div class="sinfo">
      <Result
        :type="paddingResult.type"
        title="下拉框寻找结果"
        :desc="paddingResult.desc"
        :extra="paddingResult.extra"
      >
      </Result>
    </div>
    <div class="ssubmit">
      <Button type="success" long v-if="props.num > 0">确认填充</Button>
    </div>
  </div>
</template>

<style scoped>
.sinfobody {
  font-family: "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "微软雅黑", Arial, sans-serif;
  background-color: #f8f8f9;
}

.ssubmit {
  margin: 0.3rem 0.4rem;
}
</style>
